package cn.rongdao.jrkabao.model.message;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.message.MessageDetailsBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/8/21
 */

public class MessageDetailsModel extends BaseKaMaoModel {

    public static MessageDetailsModel getInstance() {
        return getPresent(MessageDetailsModel.class);
    }

    public void execute(String messageId, Observer<MessageDetailsBean> observer) {
        addParamStrings("id", FRString.valueOf(messageId));
        Observable<MessageDetailsBean> observable = mServletApi.getMessageDetails(mParams).map(new HttpFunction<MessageDetailsBean>());
        toSubscribe(observable, observer);
    }
}
